import heapq

data = [5, 9, 1, 4, 3, 2, 8, 7, 6]
heapq.heapify(data)
print(data)
""" 
[
        1, 
      3, 2, 
    4, 9, 5, 8,
  7, 6
]
"""

h = data
print(f"min: {min(h)}, max: {max(h)}")
print(f"min: {heapq.nsmallest(1, h)[0]}, max: {heapq.nlargest(1, h)[0]}")
""" 
min: 1, max: 9
min: 1, max: 9
"""
